home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Shareware
/
IDimager Personal 4.2.0.3
/
setup_IDimager_Personal_V4.exe
/
{app}
/
web
/
api.inc
next >
Wrap
Text File
|
2008-06-27
|
4KB
|
136 lines
<script src="%var:PageOffset/js/prototype-1.6.0.2.js" type="text/javascript"></script>
<script src="%var:PageOffset/js/idimager.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="%var:PageOffset/js/utf8.js"></script>
<script language="javascript" type="text/javascript" src="%var:PageOffset/js/shadedborder.js"></script>
<script language="javascript" type="text/javascript" src="%var:PageOffset/js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
function initTinyMCE() {
tinyMCE.init
({
mode : "textareas",
theme : "simple",
force_br_newlines : true,
forced_root_block : false
});
}
function getHTML(AUrl, ATarget, AParams)
{
var url = AUrl;
var pars = AParams;
// prevent caching in IE by adding a unique ID
if (pars != '') { pars = pars + '&' };
pars = pars + '_container=' + ATarget;
if (pars != '') { pars = pars + '&' };
pars = pars + '_=' + new Date().getTime();
var myAjax = new Ajax.Updater(
{success: ATarget},
url,
{
method: 'get',
parameters: pars,
asynchronous: true,
onFailure: reportError,
onComplete: function (response) {
initTinyMCE();
}
});
}
function getHTMLChain(AChain)
{
if (AChain.length == 0) { return false };
var url = AChain[0][0];
var ATarget = AChain[0][1];
var pars = AChain[0][2];
// prevent caching in IE by adding a unique ID
if (pars != '') { pars = pars + '&' };
pars = pars + '_container=' + ATarget;
if (pars != '') { pars = pars + '&' };
pars = pars + '_=' + new Date().getTime();
var myAjax = new Ajax.Updater(
{success: ATarget},
url,
{
method: 'get',
parameters: pars,
asynchronous: true,
onFailure: reportError,
onComplete: function (response) {
initTinyMCE(); getHTMLChain(AChain.slice(1));
}
});
}
function getHTMLWithSuccess(AUrl, ASuccessURL, ATarget, ASuccessTarget, AParams)
{
var url = AUrl;
var pars = AParams;
// prevent caching in IE by adding a unique ID
if (pars != '') { pars = pars + '&' };
pars = pars + '_container=' + ATarget;
if (pars != '') { pars = pars + '&' };
pars = pars + '_=' + new Date().getTime();
var myAjax = new Ajax.Updater(
{success: ATarget},
url,
{
method: 'get',
parameters: pars,
asynchronous: true,
onFailure: reportError,
onComplete: function (response) {
initTinyMCE(); getHTML(ASuccessURL, ASuccessTarget, AParams);
}
});
}
function postForm(AForm, AUrl, ASuccessURL, ATarget, AParams)
{
var url = AUrl;
var pars = AParams;
// prevent caching in IE by adding a unique ID
if (pars != '') { pars = pars + '&' };
pars = pars + Form.serialize(AForm);
if (pars != '') { pars = pars + '&' };
pars = pars + '_container=' + ATarget;
if (pars != '') { pars = pars + '&' };
pars = pars + '_=' + new Date().getTime();
var myAjax = new Ajax.Request(
url,
{
method: 'get', // hvz; can't get the post to work here???
parameters: pars,
onFailure: function(request) {
alert('Sorry. There was an error posting or processing the data.');
getHTML(ASuccessUrl, ATarget, AParams);
},
onComplete: function (response) {
getHTML(ASuccessURL, ATarget, AParams);
}
});
}
function reportError(request)
{
alert('Sorry. There was an error retrieving the data.');
}
</script>